package com.pfsoft.data.structure.collections;/**
 * ArrayList的实现原理及练习
 * 1、ArrayList是基于数组实现的，是一个动态数组
 * 2、 ArrayList不是线程安全的，只能用在单线程环境下，多线程环境下可以考虑用Collections.synchronizedList(List l)函数返回一个线程安全的ArrayList类，
 * 也可以使用concurrent并发包下的CopyOnWriteArrayList类
 * @author PF
 * Created by dell on 2017/8/16.
 */

import java.util.*;

/**
 * com.pfsoft.practices.collections
 * ArrayList的实现原理及练习
 * @author PF
 * @create 2017-08-16 16:38
 **/
public class ArrayListDemo  implements  List{

    private    int size=0;
    private  Object[] elementData;



    public  void    test()
    {
        //使用synchronizedList包裹的ArrayList提供线程安全的类似于vector
        List<String> list1 = Collections.synchronizedList(new ArrayList<String>());

    }

    public int size() {
        return 0;
    }

    public boolean isEmpty() {
        return false;
    }

    public boolean contains(Object o) {
        return false;
    }

    public Iterator iterator() {
        return null;
    }

    public Object[] toArray() {
        return new Object[0];
    }

    public boolean add(Object o) {
        return false;
    }

    public boolean remove(Object o) {
        return false;
    }

    public boolean addAll(Collection c) {
        return false;
    }

    public boolean addAll(int index, Collection c) {
        return false;
    }

    public void clear() {

    }

    public Object get(int index) {
        return null;
    }

    public Object set(int index, Object element) {
        return null;
    }

    public void add(int index, Object element) {

    }

    public Object remove(int index) {
        return null;
    }

    public int indexOf(Object o) {
        return 0;
    }

    public int lastIndexOf(Object o) {
        return 0;
    }

    public ListIterator listIterator() {
        return null;
    }

    public ListIterator listIterator(int index) {
        return null;
    }

    public List subList(int fromIndex, int toIndex) {
        return null;
    }

    public boolean retainAll(Collection c) {
        return false;
    }

    public boolean removeAll(Collection c) {
        return false;
    }

    public boolean containsAll(Collection c) {
        return false;
    }

    public Object[] toArray(Object[] a) {
        return new Object[0];
    }
}
